<template>
  <div class="user-center">
    <!-- 顶部欢迎区 -->
    <div class="header">
      <div class="avatar-area">
        <img 
          class="avatar" 
          src="/static/touxiang.jpg" 
          alt="用户头像"
        >
		<div class="welcome-text">林航</div>
        <div class="welcome-text">ID:122512023045</div>
        <navigator url="/pages/lh111/lh111/lh111"><button class="login-btn" @click="handleLogin">登录</button></navigator>
      </div>
      <!-- 数据统计 -->
      <div class="stats">
        <div class="stat-item">
          <span class="stat-value">关注</span>
          <span class="stat-num">3</span>
        </div>
        <div class="stat-divider"></div>
        <div class="stat-item">
          <span class="stat-value">话题</span>
          <span class="stat-num">0</span>
        </div>
      </div>
    </div>

    <!-- 功能入口 -->
    <div class="func-buttons">
      <div class="func-item" @click="goTo('收藏')">
        <i class="icon star-icon"></i>
        <span class="func-text">收藏</span>
      </div>
      <div class="func-item" @click="goTo('历史')">
        <i class="icon history-icon"></i>
        <span class="func-text">历史</span>
      </div>
      <div class="func-item" @click="goTo('设置')">
        <i class="icon setting-icon"></i>
        <span class="func-text">设置</span>
      </div>
    </div>

    <!-- 内容引导区 -->
    <div class="content-guide">
      <div class="guide-icons">
        <div class="guide-icon video-icon"></div>
        <div class="guide-icon post-icon"></div>
        <div class="guide-icon link-icon"></div>
      </div>
      <div class="guide-text">
        已有385,893人<br>
        在这里发布身边的新鲜事
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter();

// 登录操作
const handleLogin = () => {
  router.push('/login');
};

// 功能入口跳转
const goTo = (target) => {
  console.log(`前往${target}页面`);
  // 实际项目中可根据target跳转对应路由
};
</script>

<style scoped>
.user-center {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background-color: #fff;
  min-height: 100vh;
}

/* 顶部欢迎区 */
.header {
  background: linear-gradient(135deg, #f875aa 0%, #f43f5e 100%);
  padding: 20px 16px;
  color: #fff;
  border-radius: 0 0 20px 20px;
}

.avatar-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
}

.welcome-text {
  font-size: 16px;
  font-weight: 500;
}

.login-btn {
  padding: 6px 14px;
  background-color: #fff;
  color: #f43f5e;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* 数据统计 */
.stats {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 14px;
  opacity: 0.9;
}

.stat-num {
  font-size: 18px;
  font-weight: 600;
  display: block;
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 24px;
  background-color: rgba(255,255,255,0.5);
}

/* 功能入口 */
.func-buttons {
  display: flex;
  justify-content: space-around;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}

.func-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f43f5e;
  font-size: 18px;
}

.star-icon::after {
  content: "★";
}

.history-icon::after {
  content: "⏱";
}

.setting-icon::after {
  content: "⚙";
}

.func-text {
  font-size: 14px;
  color: #333;
}

/* 内容引导区 */
.content-guide {
  text-align: center;
  padding: 40px 0;
  color: #999;
}

.guide-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.guide-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.video-icon {
  background-color: #bfdbfe;
}

.post-icon {
  background-color: #fecdd3;
}

.link-icon {
  background-color: #fde68a;
}

.guide-text {
  font-size: 14px;
  line-height: 1.6;
}
</style>